<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">

<script type="text/javascript" src="../js/checkProductInfo.js">
</script>

<head>
    <meta charset="UTF-8">
    <title>MyPetstore</title>
</head>
<body>
<div th:replace="common/admintop"></div>

<div id="Content">

    <div id="BackLink">
        <a th:href="@{/admin/viewProducts(pageNum = 1)}">Back</a>
    </div>

    <p align="center"><font color="red" th:text="${failMsg}">failMsg</font></p>
    <p align="center"><font color="green" th:text="${editMsg}">editMsg</font></p>

    <div id="Catalog">
        <form action="/admin/editProduct" method="post" enctype="multipart/form-data">
            <h3>Product Information</h3>

            <table class="rwd-table">
                <tr>
                    <td>Original ID:</td>
                    <td><input type="text" style="background-color:transparent;border:0;color:#ffffff;font-size:15px"
                               name="productId" readonly="readonly" th:value="${editProduct.productId}"></td>
                </tr>
                <tr>
                    <td>New Id:</td>
                    <td><input type="text" name="editId"/></td>
                </tr>
                <tr>
                    <td>Category:</td>
                    <td>
                        <select name="categoryId">
                            <option value="BIRDS"
                                    th:selected="${editProduct.categoryId eq 'BIRDS'}">
                                BIRDS
                            </option>
                            <option value="DOGS"
                                    th:selected="${editProduct.categoryId eq 'DOGS'}">
                                DOGS
                            </option>
                            <option value="CATS"
                                    th:selected="${editProduct.categoryId eq 'CATS'}">
                                CATS
                            </option>
                            <option value="FISH"
                                    th:selected="${editProduct.categoryId eq 'FISH'}">
                                FISH
                            </option>
                            <option value="REPTILES"
                                    th:selected="${editProduct.categoryId eq 'REPTILES'}">
                                REPTILES
                            </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Name:</td>
                    <td><input type="text" name="name" th:value="${editProduct.name}"/></td>
                </tr>
<!--                <tr>-->
<!--                    <td>Image:</td>-->
<!--                    <td>-->
<!--                        <input type="file" name="file" /><p>-->
<!--                    </td>-->
<!--                </tr>-->
                <tr>
                    <td>Description:</td>
                    <td>
                        <input type="text" name="word" size="50" th:value="${word}" /><p>
                    </td>
                </tr>

            </table>

            <p align="center"><font color="red" name="errormsg"></font></p>

            <input type="submit" onclick=" return check()" name="editProduct" value="Save Product Information"/>


        </form>
    </div>
</div>
<div th:replace="common/bottom"></div>
</body>
</html>